﻿using System;
using System.Collections.Generic;
using System.ServiceModel;

namespace InfFront.UICore
{
    /// <summary>
    /// InfoCommand execution process presenter (may be called asynchronously)
    /// </summary>
    [ServiceContract(Namespace = "http://InfFront.UICore")]
    public interface IExecutionControl
    {
        /// <summary>
        /// Begins the InfoCommand execution and don't return the control until it's finished
        /// </summary>
        [OperationContract]
        void Execute();

        /// <summary>
        /// Cancel the execution
        /// </summary>
        [OperationContract]
        void Cancel();

        /// <summary>
        /// The text to be shown while the execution is running
        /// For instance, if the InfoCommand's *Title* is "Up" then the *ExecutionMessage* should be "Going up" or like that
        /// </summary>
        [OperationContract]
        string GetExecutionMessage();

        /// <summary>
        /// The execution progress (value between 0.0 and 1.0)
        /// </summary>
        [OperationContract]
        float GetExecutionProgress();

        /// <summary>
        /// The text to be shown right above the progress bar 
        /// </summary>
        [OperationContract]
        string GetExecutionProgressMessage();

        /// <summary>
        /// The execution progress (value between 0.0 and 1.0)
        /// and the text to be shown right above the progress bar 
        /// </summary>
        [OperationContract]
        void GetExecutionProgressAndMessage(out float progress, out string message);
    }
}
